
$(document).ready(function(){
	jQuery.mobile.ajaxEnabled = false; 
	$(":jqmData(role='page')").attr("data-title", document.title);
	/*头部隐藏菜单*/
	//$("#top_menu").click(function(){
	//	$("#top_menubar").toggle();
	//});
	/*头部隐藏菜单*/

	/*底部隐藏菜单*/
	$("#bottom_menu").click(function(){
		$("#bottom_menubar").toggle();
	});
	/*底部隐藏菜单*/

	/*返回*/
	$(".micon-back").click(function(){
		//window.history.back(-1); 
		var url = $(this).attr('data-url');
		mybackurl(url);
		
	});

	$(".micon-user").click(function(){
		window.location.href="index.php?m=default&c=User&a=index"; 
		
	});

	$(".micon-provider-back").click(function(){
		window.history.back(-1); 
		
	});
	/*返回*/
	
	/*搜索*/
	$("#index-search-btn").click(function(){
		window.location.href="index.php?m=default&c=Category&a=searchlog"; 
		//window.location.href="{:U('Category/searchlog')}";
	});
	/*搜索*/
	var w_cate_list_small = $("#w_cate_list_small").height();

	$("#w_cate_list_big").height(w_cate_list_small);

	function mybackurl(url)
	{
		if(url == '')
		{
			window.history.back(-1); 
		}else
		{
			window.location.href = url; 
		}
	}
	
});

function saixuan_submit()
{
	
	var ishcjdc= $("#ishcjdcsel").val();
	var isnew= $("#isnewsel").val();
  	$("#ishcjdc").val(ishcjdc);
	$("#isnew").val(isnew);
}

function collect_goods(goods_id, user_id)
{
	if(user_id == '')
	{
		alert("请先登录");
		return false;
	}
	//index.php?m=default&c=user&a=add_collection
	$.ajax({
	   type: "GET",
	   url: "index.php?m=default&c=user&a=add_collection",
	   data: "id="+goods_id,
	   success: function(result){
	     window.location.reload();
	   }
	});
	
}
  

function setTab(name,cursel,n){
	 for(i=1;i<=n;i++){
	  var menu=document.getElementById(name+i);
	  var con=document.getElementById("con_"+name+"_"+i);
	  menu.className=i==cursel?"hover":"";
	  con.style.display=i==cursel?"block":"none";
	 }
	}




